package com.lhy.mymall.utils;
import org.apache.poi.ss.usermodel.Cell;

/**
 * @author: 卢辉宇
 * @date: 2023/1/23 12:41
 * @description: excel单元格取值及类型工具类
 */
public class ExcelUtil {
    public static Object getCellValue(Cell cell) {
        //根据单元格的类型返回对应的值
        switch (cell.getCellTypeEnum()) {
            case STRING:
                return cell.getStringCellValue();
            case BOOLEAN:
                return cell.getBooleanCellValue();
            case NUMERIC:
                return cell.getNumericCellValue();

        }
        return null;
    }
}
